//phantomjs
const fs = require('fs');
const path = require('path');

const jsdom = require("jsdom");
const { JSDOM } = jsdom;
const dom = new JSDOM(`<!DOCTYPE html>`);
const { window } = dom;
global.window = window;
global.document = window.document;


require('./laya');
require('./laya.LayaAnimationTool');


const root = typeof self == 'object' && self.self === self && self || typeof global == 'object' && global.global === global && global || this;

// var page = require('webpage').create();
// page.open("https://www.baidu.com/", function(status) {
// 	if (status === "success") { 
// 		console.log(page.title); 
// 	} 
// 	else {
// 		 console.log("Page failed to load."); 
// 	} 
// 	phantom.exit(0);
// });

const LoaderManager = laya.net.LoaderManager;
const ResourceManager = laya.resource.ResourceManager;
const Browser = laya.utils.Browser;

(async () => {

	Laya.init(1,1);

	let dragonBoneTools = new dragonBones.DragonBoneTools();


	function completeFun() {
		console.log("complete");
	}
	function failFun() {
		console.log("fail");
	}

	let inpath = path.resolve(__dirname, '../../laya/assets/ani/');//'http://localhost:8080/ani/';
	let outPath = path.resolve(__dirname, '../../bin/assets/ani/');
	let type = 0;

	dragonBoneTools.loadFile(inpath, outPath, completeFun, failFun, type);

//Tools.prototype.getObjectBuffer


})();

